if (typeof jmaki.YahooMapWrapper == 'undefined') {
    jmaki.YahooMapWrapper  = function(_widget) {
        
        var _wrapper = this;
        var zoom = 7;
        var autoSize = true;
        // default location to Yahoo
        
        var centerLat = 37.4041960114344;
        var centerLon = -122.008194923401;
        
        var mapType = YAHOO_MAP_SAT;
        var mapH = 0;
        var mapW = 0;
        this.map;
        var oldResize;
        var oldWidth;
        
        // pull in args
        if (typeof _widget.args != 'undefined') {
            
            if (typeof _widget.args.zoom != 'undefined') {
                zoom = Number(_widget.args.zoom);
            }
            
            if (typeof _widget.args.zoom != 'undefined') {
                zoom = Number(_widget.args.zoom);
            }
            
            if (typeof _widget.args.centerLat != 'undefined') {
                centerLat = Number(_widget.args.centerLat);
            }
            
            if (typeof _widget.args.centerLon != 'undefined') {
                centerLon = Number(_widget.args.centerLon);
            }
            
            if (typeof _widget.args.mapType != 'undefined') {
                
                if (_widget.args.mapType == 'REGULAR') {
                    mapType = YAHOO_MAP_REG;
                } else if (_widget.args.mapType == 'SATALITE') {
                    mapType = YAHOO_MAP_SAT;
                } else if (_widget.args.mapType == 'HYBRID') {
                    mapType = YAHOO_MAP_HYB;
                }
            }
            
            if (typeof _widget.args.height != 'undefined') {
                mapH = Number(_widget.args.height);
                autoSize = false;
            }
            
            if (typeof _widget.args.width != 'undefined') {
                mapW = Number(_widget.args.width);
                autoSize = false;
            }  
        }
        
        var containerDiv = document.getElementById(_widget.uuid);
        
        var layout = function() {
            // remove the listener while we do our work because ie will barf bad and resize to infinity
            if (oldWidth != document.body.clientWidth) {
                
                // for ie we need to set the postion to absoulte here or it will casue recursize resizes
                //containerDiv.style.position='absolute';
                if (containerDiv.parentNode.nodeName == "BODY") {
                   mapH = 325;
                } else {
                    mapH = containerDiv.parentNode.offsetHeight -2;      
                }
                mapW = containerDiv.parentNode.offsetWidth -2;
                var mapSize = new YSize(mapW, mapH);
                _wrapper.map.resizeTo(mapSize);
                if (oldResize) {
                    oldResize();
                }
                
                oldWidth = document.body.clientWidth;
            }        
        }
        
        if (autoSize){
            if (containerDiv.parentNode.nodeName == "BODY") {
                mapH = 325;
            } else {
                mapH = containerDiv.parentNode.offsetHeight -2;       
            }
            mapW = containerDiv.parentNode.offsetWidth -2;
            if (typeof window.onresize != 'undefined') {
                oldResize = window.onresize;
            }
            window.onresize = layout; 
            oldWidth = document.body.clientWidth;
        }
        
        var mapSize = new YSize(mapW, mapH);
        
        var centerPoint = new YGeoPoint(centerLat,centerLon);
        this.map = new YMap(containerDiv, mapType, mapSize);
        
        // Display the this.map centered on a latitude and longitude
        this.map.drawZoomAndCenter(centerPoint, zoom);
        
        // Add this.map type control
        this.map.addTypeControl();
        
        // this.map zoomer
        this.map.addZoomLong();
        
        // Set this.map type to either of: YAHOO_MAP_SAT YAHOO_MAP_HYB YAHOO_MAP_REG
        this.map.setMapType(mapType);
    }
}

var yWrapper = new jmaki.YahooMapWrapper(widget);
// add to the instance this.map for later refernece
jmaki.attributes.put(widget.uuid, yWrapper);